$(document).ready(function () {
    var currClientWidth,
        fontValue,
        originWidth;
    originWidth = 750;//ui 750 640
    __resize();
    window.addEventListener('resize', __resize, false);

    function __resize() {
        currClientWidth = document.documentElement.clientWidth;
        if (currClientWidth > 768) {
            currClientWidth = 768;
        }
        if (currClientWidth < 320) {
            currClientWidth = 320;
        }
        fontValue = (((625 * currClientWidth) / originWidth).toFixed(2)) * 2;
        document.documentElement.style.fontSize = fontValue + '%';
    }

    // 隐藏首次弹框
    $('#alertConfirm').click(function () {
        $('.showMessage').hide()
        $('.mint-popup').hide()
    })

    // 拷贝金额及账号
    var clipboard = new ClipboardJS("#copyBank", {
        text: function (e) {
            console.log(e)
            return document.querySelector('#Bank'); //复制标签文本
        }
    })
    clipboard.on("success", function (e) {
        console.log(e)
    })
    var clipboard1 = new ClipboardJS("#copyAccount", {
        text: function (e) {
            console.log(e)
            return document.querySelector('#Account'); //复制标签文本
        }
    })
    clipboard1.on("success", function (e) {
        console.log(e)
    })

    var clipboard2 = new ClipboardJS("#copyIfscs", {
        text: function (e) {
            console.log(e)
            return document.querySelector('#Ifsc'); //复制标签文本
        }
    })
    clipboard2.on("success", function (e) {
        console.log(e)
    })
    var clipboard3 = new ClipboardJS("#copyState", {
        text: function (e) {
            console.log(e)
            return document.querySelector('#State'); //复制标签文本
        }
    })
    clipboard3.on("success", function (e) {
        console.log(e)
    })
    var clipboard4 = new ClipboardJS("#copyBranch", {
        text: function (e) {
            console.log(e)
            return document.querySelector('#Branch'); //复制标签文本
        }
    })
    clipboard4.on("success", function (e) {
        console.log(e)
    })
    var clipboard5 = new ClipboardJS("#copyAccountholdername", {
        text: function (e) {
            console.log(e)
            return document.querySelector('#Accountholdername'); //复制标签文本
        }
    })
    clipboard5.on("success", function (e) {
        console.log(e)
    })
    var clipboard6 = new ClipboardJS("#copyAmount", {
        text: function (e) {
            console.log(e)
            return document.querySelector('#Amount'); //复制标签文本
        }
    })
    clipboard6.on("success", function (e) {
        console.log(e)
    })
    // 提交utr
    $('#submit').click(function () {
        // var testUrl = 'http://superapp.shareshortvideo.com/index/index/submitUTR'
        var reviewUrl = 'https://api.aicashloanindia.com/index/index/submitUTR'

        var utrs = $('#utr').val();

        if (utrs == '') {
            return;
        }
        $.post(reviewUrl, {
            id: getUrlParam('id'),
            outTradeNo: getUrlParam('outTradeNo'),
            utr: utrs
        }, function (data, status) {
            console.log(data)
        });
    })

    function getUrlParam(name) {
        var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)"); //构造一个含有目标参数的正则表达式对象
        var r = window.location.search.substr(1).match(reg);  //匹配目标参数
        if (r != null) return unescape(r[2]);
        return null; //返回参数值
    }

    $('#transferAccount').click(function () {
        $('.showMessage').show()
        $('.software_list').toggle()
    })
    $('#Cancel').click(function () {
        $('.showMessage').hide()
        $('.software_list').toggle()
    })
    $('#explainBtn-box-rightbox-title').click(function () {
        $('.showMessage').show()
        $('.mint-popup').show()
    })
    $('#paytm').click(function () {
        alert('点击了paytm')
    })
    $('#phonepe').click(function () {
        alert('点击了phonepe')
    })
    $('#gpay').click(function () {
        alert('点击了gpay')
    })
    $('#mobikwik').click(function () {
        alert('点击了mobikwik')
    })

});
